#pragma once

#if !defined(__cplusplus) && __STDC_VERSION__ < 201112L
    #error "This program requires C11 or later"
#endif

#define __STDC_WANT_LIB_EXT1__ 0
#include <stdio.h>
#include <stdlib.h>

#define HM_private \
    static inline

#if defined(__GNUC__) || defined(__clang__)
    #define HM_noreturn __attribute__((noreturn))
#elif defined(_MSC_VER)
    #define HM_noreturn __declspec(noreturn)
#elif 201112L <= __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
    #define HM_noreturn _Noreturn
#elif __STDC_VERSION >= 202311L
    #define HM_noreturn [[noreturn]]
#else
    #define HM_noreturn
#endif

#define HM_throw(exception, err_msg) \
    do { \
        fprintf(stderr, "::hostel_manager::" #exception  ": "  err_msg "\n"); \
        _Exit(1); \
    } while(0)
